import json

from 频域分析.demoPyNettest import get_cztdata_process


def readjson(filename):
    with open(filename, "r", encoding="utf-8-sig") as json_file:
        data = json.load(json_file)
    return data


if __name__ == '__main__':

    data = readjson("../慢跑_紧佩戴_9_02121114_rxfhdllbhxvbgsbm_时间段_2025-02-12 111449~2025-02-12 111458.json")
    windos_data=data[1]['RawData20']
    #now_sig_czt, now_sig_freq, max_peak_of_wave, some_peak_of_wave, energy_ratio_of_wave, peak_list, frequency_peaks_list, czt_values_list, ac_dc_energy=get_cztdata_process(windos_data,25,None,data[0]['label_value'])
    now_sig_czt, now_sig_freq, max_peak_of_wave, some_peak_of_wave, energy_ratio_of_wave, peak_list, frequency_peaks_list, czt_values_list, ac_dc_energy=get_cztdata_process(windos_data,25,None,data[0]['label_value'])
    print(now_sig_czt)
    print(now_sig_freq)
    print(max_peak_of_wave)
    print(some_peak_of_wave)
    print(energy_ratio_of_wave)
    print(peak_list)
    print(frequency_peaks_list)
    print(czt_values_list)
    print(ac_dc_energy)
   
    pass



